package com.cloudcentral.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 台站设备信息上报记录表
 * </p>
 *
 * @author Administrator
 * @since 2023-11-22
 */
@Data
@SuperBuilder
@JsonSerialize
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("sys_radio_device")
@Schema(name = "RadioDevice", description = "台站设备信息上报记录表")
public class RadioDevice implements Serializable {

  @Schema(description = "ID")
  @TableId(type = IdType.AUTO)
  private Long id;

  @Schema(description = "台站ID")
  @TableField(keepGlobalFormat = true)
  private Integer radioId;

  @Schema(description = "温度")
  @TableField(keepGlobalFormat = true)
  private Double temperature;

  @Schema(description = "电流")
  @TableField(keepGlobalFormat = true)
  private Double electricCurrent;

  @Schema(description = "前向电压")
  @TableField(keepGlobalFormat = true)
  private Double frontVoltage;

  @Schema(description = "后向电压")
  @TableField(keepGlobalFormat = true)
  private Double backVoltage;

  @Schema(description = "频率")
  @TableField(keepGlobalFormat = true)
  private Double frequency;

  @Schema(description = "功率")
  @TableField(keepGlobalFormat = true)
  private Integer power;

  @Schema(description = "上报时间")
  @TableField(keepGlobalFormat = true, insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date reportTime;
}
